using System.Data;
using Sanelib.DataOperation;
using Sanelib.DataOperation.Attribute;
using Sanelib.DataOperation.Base;

namespace Core.Domain.Model
{
	[EntityName("Templete")]
	public class Templete : Entity
	{
		public string Name { get; set; }
		public string Value { get; set; }

		public override void From(IDataReader dataReader)
		{
			base.From(dataReader);
			Name = dataReader.ReadNullSafeString("Name");
			Value = dataReader.ReadNullSafeString("Value");
		}

		public override void To(System.Data.SqlClient.SqlCommand cmd)
		{
			base.To(cmd);
			cmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = Name;
			cmd.Parameters.Add("@Value", SqlDbType.NVarChar).Value = Value;
		}
	}
}
